Repository navigation
feat(ai): custom providers/profiles, agent skills/tools, and MCP foundation - #415
Open
NabinSharmaitgithub wants to merge 6 commits into
Open
NabinSharmaitgithub wants to merge 6 commits into
NabinSharmaitgithub wants to merge 6 commits into
Conversation
Adds a configurable custom provider for the AI Agent: - New CustomProvider (OpenAI-compatible chat completions endpoint) - Configurable base URL, model name, and optional API key - Settings UI entries and sidebar configuration dialog - Registered in agent manager, model/provider selection, and API key helpers
…P foundation - Multiple saved custom OpenAI-compatible provider profiles (add/edit/delete/activate) with legacy migration - Reusable agent prompt profiles + prebuilt skills (file reader, command run [opt-in], file modification, Stitch, design, custom) - Built-in agent tools/capabilities (read_file, list_files, search_project, get_project_tree, modify_file, run_command gated) - MCP client foundation (HTTP JSON-RPC/SSE-compatible), server config storage, and prebuilt MCP presets (GitHub, Firebase, Stitch, Vercel, Cloudflare, Supabase, custom) - Agent loop integration in AIAgentManager for text-based TOOL_CALL/TOOL_RESULT - Sidebar AI Preferences UI for agent profiles and MCP servers
…mable HTTP headers - Extend AIAgent with optional native tool-calling API (backward compatible defaults) - AIAgentManager prefers native tool path when provider supports it (fallback to text protocol) - CustomProvider: full OpenAI-style native tool calling with tool_call/tool result messages - Per-tool enable/disable (checkboxes) in Agent Profile UI; profile store supports disabledTools - MCP client: Mcp-Session-Id handling, MCP-Protocol-Version header, improved SSE/JSON and 202/204 handling
- Add OpenAICompatNative helper (OpenAI-style tools/tool_calls/tool results) - LocalLLM: full native tool-calling support (OpenAI-compatible endpoint) - OpenAI: native tool-calling overrides (generateWithTools/submitToolResults) - DeepSeek: native tool-calling overrides (OpenAI-compatible endpoint) - Grok: native tool-calling overrides (OpenAI-compatible endpoint) - Agent manager already prefers native tool path when supportsNativeTools() is true
- Anthropic: native tool use/tool_result via Messages API (raw HTTP), structured content blocks, system+agent profile composition - Gemini: native function calling via Gemini REST generateContent (functionDeclarations/functionCall/functionResponse), avoids SDK version coupling - Both integrate with AIAgentManager native tool loop and support per-tool/profile toggles
…ntinue-in-inline-lambda) - DeepSeek/Grok: remove duplicate org.json JSONArray/JSONObject imports - McpClient/AgentPromptProfile/CustomProviderProfile: replace non-local continue inside ifBlank (requires Kotlin 2.2) with regular if-check for compatibility
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the requested AI agent enhancements in GitHub for Android Code Studio (AI Agent).
Delivered (all requested items)
Mcp-Session-Id,MCP-Protocol-Version), JSON/SSE and 202/204 handling, MCP server management UI, and prebuilt presets/templates: GitHub, Firebase, Stitch, Vercel, Cloudflare, Supabase (superbase), Custom MCP (disabled by default; user configures URL/auth).read_file,list_files,search_project,get_project_tree,modify_file, gatedrun_command), per-tool enable/disable in agent profiles, MCP tool discovery/calls, and a bounded agent tool loop.AIAgentextended with optional native tool API (backward-compatible defaults).AIAgentManagerprefers native tool calls when supported, with text-protocol fallback (TOOL_CALL/TOOL_RESULT). Native implementations added for Custom, Local LLM, OpenAI, DeepSeek, Grok, Anthropic, Gemini.Key files
AIAgent.kt,AIAgentManager.kt— native/text tool loop, provider-agnostic tool executiontools/AITools.kt,tools/OpenAICompatNative.kt— tool defs/protocol, built-in executor, OpenAI-compatible native helperprofiles/AgentPromptProfile.kt,profiles/CustomProviderProfile.kt— profiles, skill presets, per-tool toggles, migrationmcp/McpClient.kt,mcp/McpModels.kt— MCP client/presetsdialogs/AgentProfilesDialog.kt,dialogs/McpServersDialog.kt,dialogs/CustomProviderConfigDialog.kt— management UIagents/{custom,local,openai,deepseek,grok,anthropic,google}/*— provider integration + native tool callingNotes / caveats
run_commandis opt-in and gated by the active agent profile (allowCommandExecution).generateContentfunction-calling format (not SDKToolobjects) to avoid SDK-version coupling; existing SDKgenerateCodepath remains for non-tool requests.Target base:
dev(from forkNabinSharmaitgithub/android-code-studio:feature/custom-ai-provider)